/**
 * org.assess.core.listener.SessionListener
 */
package org.assess.core.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.assess.core.bean.UserSession;
import org.assess.core.common.Constants;

/**
 * @description 用户session的监听
 * @author XiaLongxiang
 * @createtime 2011-8-2 下午04:39:16
 */
public class SessionListener implements HttpSessionListener {
    public void sessionCreated(HttpSessionEvent event) {
        String sessionId = event.getSession().getId();
        UserSession user = new UserSession();
        user.setSessionId(sessionId);
        user.setTheme(Constants.G_DEFAULT_THEME);
        event.getSession().setAttribute(Constants.G_USER_SESSION, user);
    }
    
    public void sessionDestroyed(HttpSessionEvent event) {
        
    }
}
